import request from '@/utils/request'

// 注册接口
export const userRegisterService = ({ username, password, repassword }) => {
    return request.post('/api/reg', { username, password, repassword })
}
// 登录接口
export const userLoginService = ({ username, password }) => {
    return request.post('/api/login', { username, password })
}
// 获取用户信息接口
export const userGetInfoService = () => {
    return request.get('/my/userinfo')
}

// 更新用户资料
export const useUpdataInfo = (data) => {
    return request.put('/my/userinfo', data)
}

// 更新用户密码
export const userUpdataPwd = (data) => {
    return request.patch('/my/updatepwd', data)
}

// 更新用户头像
export const userUpdataPic = (data) => {
    return request.patch('/my/update/avatar', data)
}